<?php
	session_start();//Khoi tao bien session
	$url_dir=$url=$host=$user=$pass=$database_name=$page=$form=$id=$action=$success=$alert="";
	require_once('../configs/config.php');
	require_once('../model/thuvien.php');
	$url_dir=$url.'admin/view/';
	$url=$url.'admin/';
	$lib=new LIB();
	$lib->ketnoi($host,$user,$pass,$database_name);
	if(isset($_SESSION['loginadmin'])){
		$loginadmin=$_SESSION['loginadmin'];
	}elseif(isset($_COOKIE['rememberadmin'])){
		$one=$lib->selectone("SELECT * FROM tb_user WHERE id=".$_COOKIE['rememberadmin']);
	if(isset($one->id)) $_SESSION['loginadmin']=$one;
		$loginadmin=$_SESSION['loginadmin'];
	}
?>